<?php
class GraphTester extends CI_Controller {
	function __construct() {
		parent::__construct();
		$this->load->model('graph');
	}
	
	public function test1() {
		$this->graph->addEdge(1, 2);
		$this->graph->addEdge(2, 3);
		$this->graph->displayGraph();
		$this->graph->displayIds();
		
		if($this->graph->isTopological() == true) echo 'no loop';
		else									  echo 'loop';
	}
	
	public function test2() {
		$this->graph->addEdge(1, 2);
		$this->graph->addEdge(2, 3);
		$this->graph->addEdge(3, 4);
		$this->graph->addEdge(4, 2);
		$this->graph->displayGraph();
		$this->graph->displayIds();
		
		if($this->graph->isTopological() == true) echo 'no loop';
		else									  echo 'loop';
	}
}
?>